from Celery_program import celery_app
import time


@celery_app.task
def celery_demo_task(x, y):
    """ celery 异步任务 样例 """
    print("----------- API自动化测试 START -----------")
    time.sleep(5)
    sum = x + y
    time.sleep(5)
    print("----------- API自动化测试 END -----------")
    return sum


@celery_app.task
def add(x, y):
    time.sleep(10)
    return x + y


@celery_app.task(name="abc")
def multiply(x, y):
    time.sleep(5)
    return x * y